package com.resafety.springcloud.controller;

import com.resafety.springcloud.service.PaymentService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@Slf4j
public class PaymentController {
    @Resource
    private PaymentService paymentService;

    @Value("${server.port}")
    private String port;

    @RequestMapping("paymentok/{id}")
    public String Payment_OK(@PathVariable("id") Integer id){
     return   paymentService.Paymentinfo_Ok(id)+"\t"+port;
    }

    @RequestMapping("paymenttimeout/{id}")
    public String Payment_timeout(@PathVariable("id") Integer id){
        return   paymentService.Paymentinfo_timerOut(id)+"\t"+port;
    }
}
